<?php

namespace app\admin\service\statistics\promotion\wx;

use app\admin\service\statistics\promotion\AbstractComputeStatistician;
use app\admin\service\statistics\traits\CompletionTrait;
use app\admin\service\statistics\traits\FilterTrait;
use app\admin\service\statistics\traits\GrouperCreatedToDateTrait;
use function show_percentage;

/**
 * 渠道数据 WX 留资
 * Class LoginRegisterRate
 * @package app\admin\service\statistics\promotion\wx
 */
class LiuzhiCount extends AbstractComputeStatistician
{
    // 补齐
    use CompletionTrait;

    // new_member_count,captcha_count
    protected function compute(int $index)
    {
        return '';

        $statisticians = $this->statisticians;

        $wenda_count = $statisticians['wx-wenda_count'][$index]['value'] ?? null;

        $anyuan_count = $statisticians['wx-anyuan_count'][$index]['value'] ?? null;

        if (!is_numeric($wenda_count) || !is_numeric($anyuan_count)) {
            return '';
        }

        return $wenda_count + $anyuan_count;
    }

    protected function getDefaultValue()
    {
        return '0';
    }
}